import QtQuick 1.0

Item {
    property alias text: labelText.text
    property alias pointSize: labelText.font.pointSize
    signal clicked
    width: labelText.width+40

    onWidthChanged: {
        console.log("MAXMAXMAX/button.width="+width)
    }

    Text {
        id: labelText
        anchors.centerIn: enabledImage
        color: "white"
        z: 1
    }

    onEnabledChanged: {
        enabledImage.visible = enabled
        disabledImage.visible = !enabled
    }

    Image {
        id: enabledImage
        width: parent.width
        visible: true
        source: "button-enabled-alpha.png"
        z: 0
    }
    Image {
        id: disabledImage
        width: parent.width
        visible: false
        source: "button-disabled-alpha.png"
        z: 0
    }

    MouseArea {
        anchors.fill: parent
        onClicked: parent.clicked()
    }
}
